home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / mx / logging / LogEvent.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  1.3 KB  |  53 lines

  1. package mx.logging
  2. {
  3.    import flash.events.Event;
  4.    import mx.core.mx_internal;
  5.    
  6.    use namespace mx_internal;
  7.    
  8.    public class LogEvent extends Event
  9.    {
  10.       mx_internal static const VERSION:String = "2.0.1.0";
  11.       
  12.       public static const LOG:String = "log";
  13.       
  14.       public var level:int;
  15.       
  16.       public var message:String;
  17.       
  18.       public function LogEvent(param1:String = "", param2:int = 0)
  19.       {
  20.          super(LogEvent.LOG,false,false);
  21.          this.message = param1;
  22.          this.level = param2;
  23.       }
  24.       
  25.       public static function getLevelString(param1:uint) : String
  26.       {
  27.          switch(param1)
  28.          {
  29.             case LogEventLevel.INFO:
  30.                return "INFO";
  31.             case LogEventLevel.DEBUG:
  32.                return "DEBUG";
  33.             case LogEventLevel.ERROR:
  34.                return "ERROR";
  35.             case LogEventLevel.WARN:
  36.                return "WARN";
  37.             case LogEventLevel.FATAL:
  38.                return "FATAL";
  39.             case LogEventLevel.ALL:
  40.                return "ALL";
  41.             default:
  42.                return "UNKNOWN";
  43.          }
  44.       }
  45.       
  46.       override public function clone() : Event
  47.       {
  48.          return new LogEvent(message,level);
  49.       }
  50.    }
  51. }
  52.  
  53.